/**
 *
 * @author 
 * 关卡数据
 */
class GameManager extends egret.EventDispatcher {
    private static _i: GameManager;
    public static get i(): GameManager {
        if(!this._i)
            this._i = new GameManager();
        return this._i;
    }
    public constructor() {
        super();
    }
	//金币
    private _gold: number = 0;
    public set gold(value: number) {
        this._gold = value;
		Global.dispatchEvent(Events.GlobalGold);
    }
    public get gold(): number {
        return this._gold;
    }
    
	private _gameflag:boolean =false;
    public get gameflag():boolean {
        return this._gameflag;
    }
	
    public GameStart(): void {
		this._gameflag = true;
    }
	
    public GameResume(): void {
		this._gameflag = true;
        EnemyManage.i.AllPlay();
    }
	
    public GamePause(): void {
		this._gameflag = false;
		
        EnemyManage.i.AllStop();
    }
    
    public GameReStart(): void {
		this._gameflag = true;
        Global.dispatchEvent(MainNotify.closeSetPanelNotify);
        Global.dispatchEvent(MainNotify.closeGameOverPanelNotify);
		
		BowManage.i.GameReStart();
		BuildManage.i.GameReStart();
		EnemyManage.i.GameReStart();
		SkillManager.i.GameReStart();
		
    }
    public GameOver(): void {
		this._gameflag = false;
    }

}